#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Quantity.h>

USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(Quantity)
{
	TEST(Length can be checked whether mile and yard are equal)
	{
		Length mile(1, MILE), yard(1760, YARD);
		ASSERT_EQ(true, mile == yard);
	}

	TEST(Length can be checked whether mile and yard are not equal)
	{
		Length mile(1, MILE), yard(100, YARD);
		ASSERT_EQ(false, mile == yard);
	}

	TEST(Length can be added)
	{
		Length inch1(13, INCH), inch2(11, INCH), feet(2, FEET);
		ASSERT_TRUE((inch1 + inch2) == feet);
	}

	TEST(Volume can be checked whether oz and TBSP are equal)
	{
		Volume oz(1, OZ ), tbsp(2, TBSP);
		ASSERT_EQ(true, oz == tbsp);
	}

	TEST(Volume can be checked whether oz and tbsp are not equal)
	{
		Volume oz(1, OZ), tbsp(100, TBSP);
		ASSERT_EQ(false, oz == tbsp);
	}

	TEST(Volume can be added)
	{
		Volume tsp(3, TSP), tbsp(1, TBSP), oz(1, OZ);
		ASSERT_TRUE((tsp + tbsp) == oz);
	}

	TEST(Length can be print)
	{
		Quantity<LengthUnit> len(2, MILE);
		std::stringstream out;

		len.printQuantity(out, lengthUnitType);
		ASSERT_EQ(std::string("2 MILE \n"), out.str());
	}

};
